package com.base.http

/**
 * 请求响应 这个类不关注错误码 只关心是否请求成功
 * onResponse(boolean: Boolean,model: M?)
 * boolean = true 为请求成功
 * boolean = false 为请求失败
 */
open class HttpResponse<M>: HttpListener<M>(){

    final override fun onResponse(request: Int, model: M?) {
        onResponse(true,model)
    }

    final override fun onError(request: Int, e: Throwable?, code: Int) {
        onResponse(false,null)
    }

    open fun onResponse(boolean: Boolean,model: M?){}
}